package com.zx._10_设计模式.创建型模式.单例模式;

/**
 * 单例模式--1. 最简单的版本(数据不安全的)
 */
public class Singleton1 {

    private static Singleton1 singleton;

    private Singleton1() {
    }

    public static Singleton1 getInstance() {
        if (singleton == null) {
            return singleton = new Singleton1();
        }
        return singleton;
    }
}
